<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://checkout.juicyway.com/pay.js"></script>
    <script> function openWidget() {
        Juicyway.PayWithJuice({
            // Configuration options detailed below
            onClose: () => {
                // Called when user closes widget
            },
            onSuccess: () => {
                // Called when payment is successful
            },
            onError: (error) => {
                // Called when payment fails
            },
            // Required parameters
            reference: "incomingweb2025041705",
            amount: 1000,
            currency: "USD",
            description: "Product purchase",
            isLive: true,
            key: "q0eP/T/j25HpMJrDWYDtewKpd6wty88o9HGeyIQXhNjMR882BR656zePCvFJPnuHkcOmRCtE2Mcg/3JhciBOLQ==",
            order: {
                identifier: "ORDER123",
                items: [
                    {
                        name: "E-book",
                        type: "digital",
                        qty: 1,
                        amount: 1000
                    }
                ]
            },
            // Optional parameters
            appName: "Your App Name",
            customer: {
                email: "customer@email.com",
                first_name: "Test",
                last_name: "Customer",
                phone_number: "+1234567890",
                billing_address: {
                    line1: "123 Main St",
                    city: "San Francisco",
                    state: "CA",
                    zip_code: "94105",
                    country: "US"
                }
            },
            paymentMethod: {
                type: "crypto_address"
            },
            metadata: {
                // Additional payment metadata
            }
        });
    }</script>
</head>
<body>
<button onclick="openWidget()">Make Payment</button>
</body>
</html>